/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* 背景图片容器 */
.splash-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('image/startpage.jpg');
    background-size: contain;
    background-position: center;
    transition: opacity 1.5s ease;
    z-index: 10;
}
.splash-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom, 
        rgba(26,26,46,0.3), 
        rgba(26,26,46,0.6), 
        rgba(26,26,46,0.9)
    );
    pointer-events: none;
    z-index: 1;
}

/* 登录表单容器 */
.login-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    width: 380px;
    padding: 40px 30px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease 0s; /* 修改：移除原3s延迟，由JS控制显示时机 */
    position: relative;
    overflow: hidden;
    z-index: 5;
}

.login-container.show {
    opacity: 1;
    transform: translateY(0);
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        transparent,
        rgba(168, 239, 255, 0.8),
        transparent 30%
    );
    animation: rotate 6s linear infinite;
    z-index: -1;
}

/* 错误提示样式 */
.error-message {
    color: #ff6b6b;
    font-size: 0.9rem;
    margin-top: -15px;
    margin-bottom: 15px;
    text-align: left;
    padding-left: 20px;
    display: none;
}

/* 输入框错误状态 */
.input-group.error input {
    border-color: #ff6b6b;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
}

.input-group.error i {
    color: #ff6b6b;
}

/* 抖动动画效果 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

.login-header {
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 2.5rem;
    color: #0f3460;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #5563de);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 1rem;
}

.input-group {
    position: relative;
    margin-bottom: 25px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
    transition: color 0.3s;
}

input {
    width: 100%;
    padding: 15px 15px 15px 50px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    background-color: #f5f5f5;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
    color: #333;
}

input::placeholder {
    color: #999;
}

input:focus {
    border-color: #4ecdc4;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.3);
}

input:focus + i {
    color: #4ecdc4;
}

.login-btn {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 0;
    width: 100%;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.6);
}

.login-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(25deg);
    transition: all 0.7s;
}

.login-btn:hover::after {
    left: 120%;
}

.additional-links {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
}

.additional-links a {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.additional-links a:hover {
    color: #ff6b6b;
}

.footer {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* 用户界面 */
.user-dashboard {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dashboard-header h2 {
    color: white;
    font-size: 1.8rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #4ecdc4;
}

.user-info span {
    color: white;
    font-weight: 600;
}

.dashboard-content {
    padding: 40px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.welcome-box {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.welcome-box h3 {
    color: white;
    font-size: 2rem;
    margin-bottom: 15px;
}

.welcome-box p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.stats-container {
    display: flex;
    gap: 20px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px;
    flex: 1;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-10px);
}

.stat-card h4 {
    color: #4ecdc4;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.stat-card .number {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
}

.stat-card .label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .login-container {
        width: 90%;
        padding: 30px 20px;
    }
    
    .stats-container {
        flex-direction: column;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .dashboard-content {
        padding: 20px;
    }
}

/* 用户界面特有样式 */
.logout-btn {
    background: rgba(255, 107, 107, 0.7);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 8px 15px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 15px;
}

.logout-btn:hover {
    background: rgba(255, 107, 107, 1);
    transform: translateY(-2px);
}

.quick-actions {
    margin-top: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.quick-actions h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.action-btn {
    background: rgba(78, 205, 196, 0.3);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 15px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.action-btn i {
    font-size: 2rem;
}

.action-btn:hover {
    background: rgba(78, 205, 196, 0.5);
}

.online {
    color: #4ecdc4;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

.toast-success {
    background-color: #4ecdc4;
}

.toast-error {
    background-color: #ff6b6b;
}

.fade-out {
    animation: fadeOut 0.3s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translate(-50%, 0); }
    to { opacity: 0; transform: translate(-50%, 20px); }
}